import pymysql
sqlname = "demo_btc"
db = pymysql.connect(host="localhost", user='root', password='663666', port=3306, db='btu')
cursor = db.cursor()
query = "select count(*) from {}".format(sqlname)
cursor.execute(query)
db.commit()
count_wm = cursor.fetchall()
print(sqlname, "数据库表中共有", count_wm[0][0], "数据")